import java.util.Random;

/**
 * Created by hps on 17-4-30.
 */
public class ListInsertionSortApp {
    public static void main(String[] args) {
        int size = 10;
        Link1[] linkArray = new Link1[size];

        for (int i = 0; i < size; i++) {
            Random random = new Random();
            long n = random.nextInt(100);

            linkArray[i] = new Link1(n);
        }

        System.out.print("Unsorted array: ");
        for (int i = 0; i < size; i++) {
            System.out.print(linkArray[i].dData + " ");
        }
        System.out.println();

        SortedList1 sortedList1 = new SortedList1(linkArray);
        for (int i = 0; i < size; i++) {
            linkArray[i] = sortedList1.remove();
        }

        System.out.print("Sorted array: ");
        for (int i = 0; i < size; i++) {
            System.out.print(linkArray[i].dData + " ");
        }
        System.out.println();
    }
}
